package com.innowake.formatter;

public class FormatterFactory {
    // use getFormatter method to get object of type Formatter
    public Formatter getFormatter(FormatterType FormatterType) {

        if (FormatterType == null) {
            return null;
        }
        if (FormatterType.equals(FormatterType.DateFormatter)) {
            return new DateFormatter();
        } else if (FormatterType.equals(FormatterType.PhoneNumberFormatter)) {
            return new PhoneNumberFormatter();
        } else if (FormatterType.equals(FormatterType.NumberFormatter)) {
            return new NumberFormatter();
        }
        return null;
    }
}